<?php
require("global.php");

if(isset($phprpg->input['pid'])){
	$pid = $phprpg->input['pid'];
}else{
	//throw logged in user's profile
	$pid = $phprpg->player['pid'];
}

$pid = intval($pid);
$getPlayer = $db->select("players","*","pid={$pid}");
$player = $db->fetchrow($getPlayer);
if($player){
	//date format setting needed?
	$regdate = date("F j, Y, g:i a",$player['regdate']);
	eval("\$userprofile = \"".$templates->get("profile_table")."\";");
	eval("\$profile = \"".$templates->get("profile")."\";");
	$templates->output($profile);
}else{
	$phprpg->error_page("The profile you selected is unavailable.");
}
?>